package org.light.framework.mvc;

import java.util.*;
import org.light.framework.util.StringUtil;

/**
 * 请求参数类
 * @author de.cel
 *
 */
public class RequestParam {
	
    private final Map<String, Object> fieldMap;

    public RequestParam(Map<String, Object> fieldMap) {
        this.fieldMap = fieldMap;
    }

    public Map<String, Object> getFieldMap() {
        return fieldMap;
    }

    public String getString(String name) {
        return StringUtil.toString(get(name));
    }

    public double getDouble(String name) {
        return StringUtil.toDouble(get(name));
    }

    public long getLong(String name) {
        return StringUtil.toLong(get(name));
    }

    public int getInt(String name) {
        return StringUtil.toInt(get(name));
    }

    private Object get(String name) {
        return fieldMap.get(name);
    }
	
}
